#import('dart:html');
#source("Timer.dart");

class simple_test {

  Timer timer;
  num clockTick;
  
  simple_test() {
    timer = new Timer();
  }

  void run() {
    write("Dartender!");
    
    
  }
  
  void start() {
    print("starting game");
    window.webkitRequestAnimationFrame(loop);
  }
  
  
  void loop(int time) {
    print("loop");
    clockTick = this.timer.tick();
    //update();
    draw();
    //click = null;
    window.webkitRequestAnimationFrame(loop);
  }
  
  void draw() {
    
  }

  void write(String message) {
    // the HTML library defines a global "document" variable
    document.query('#status').innerHTML = message;
  }
}

void main() {
  simple_test st = new simple_test();
  st.run();
  
  st.start();
}
